home *** CD-ROM | disk | FTP | other *** search
- Path: news.uni-jena.de!news
- From: mkt@isun04.inf.uni-jena.de (Tilo Koerbs)
- Newsgroups: comp.lang.c++
- Subject: Strange error in SPARCompiler.
- Date: 5 Feb 1996 11:21:03 GMT
- Organization: Lehrstuhl fuer Rechnerarchitektur- und kommunikation, FSU Jena
- Message-ID: <4f4p6v$ah0@fsuj01.rz.uni-jena.de>
- Reply-To: mkt@isun04.inf.uni-jena.de
- NNTP-Posting-Host: isun07.inf.uni-jena.de
-
- My SPARCompiler 4.0? shows a very strange behaviour:
-
- struct X {
- int i1, i2;
- };
-
- void f(const X& x) {
- int& i = x.i2; // Warning: Temporary used... (now obsolete)
- int& ii = 1 ? x.i1 : x.i2; // NO ERROR, NO WARNING!!!
- }
-
- Although the first initialization should be an error in a newer compiler, it
- is still only a warning (like Borland 4.0).
-
- The second initialization in in no part dirrerent from the first. What to hell
- is my compiler doing here? It prints not even a warning message!!! And for sure:
- it uses NO temporary!
-
- Does newer versions of my SPARCompiler have this error too?
- And did Borland and SUN changed from a warning to an error?
-
- Bye.
- Tilo Koerbs, mkt@uni-jena.de
-
-
-